import http from '../../../http/http'
import * as url from '../../../http/api'

const state = {

};
const actions ={
    addDataMan({commit},obj){
        console.log(obj)
        //console.log(obj.get('upload'))
        return http({
            url:url.systemManagementUpload,
            method:'post',
            data:obj,
            processData : false,//必须为false，才能自动添加正确的content-type
            contentType : false,// 避开jQuery对formData的默认处理
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    getDataMan({commit},obj){
        return http({
            url:url.systemManagementBackUp,
            method:'post',
            data:obj
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    getDataManType({commit}){
        return http({
            url:url.systemManagementBackUpType,
            method:'post',
        }).then(resp=>{
           return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    getPageLog({commit},obj){
        return http({
            url:url.logManagementPage,
            method:'post',
            data:obj
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
    selectPageLog({commit},obj){
        return http({
            url:url.logManagementSelect,
            method:'post',
            data:obj
        }).then(resp=>{
            return resp.data
        }).catch(err=>{
            console.log(err)
        })
    },
};
const mutations = {

};

export default{
    state,
    actions,
    mutations
}